package com.changli06._collections.exer1;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;

public class cardTest {
    public static void main(String[] args) {
        String [] num = new String []{"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        String [] color = new String []{"方片♦","梅花♣","红桃♥","黑桃♠"};
        ArrayList list = new ArrayList();
        for(String s:num){
            for(String c:color){
                String card = s+c;
                list.add(card);
            }
        }
//        System.out.println(list);
        list.add("BigJoker");
        list.add("SmallJoker");
        ArrayList list1 = new ArrayList();
        ArrayList list2 = new ArrayList();
        ArrayList list3 = new ArrayList();
        ArrayList Three = new ArrayList();
        Collections.shuffle(list);
        int randint1 = (int)(Math.random()*list.size());
        int randint2 = (int)(Math.random()*list.size());
        int randint3 = (int)(Math.random()*list.size());
        Three.add(list.get(randint1));
        Three.add(list.get(randint2));
        Three.add(list.get(randint3));
//        System.out.println(Three);
        int i = 0;
        while(i<54){
            list1.add(list.get(i));
            i++;



            list2.add(list.get(i));
            i++;

            list3.add(list.get(i));
            i++;
        }
        System.out.println("Player1:");
        System.out.println(list1);
        System.out.println("Player2:");
        System.out.println(list2);
        System.out.println("Player3:");
        System.out.println(list3);
        System.out.println("底牌:");
        System.out.println(Three);
    }

}
